<script setup>
import { artGetChannelsService } from '@/api/article'
import { ref, defineProps, defineEmits } from 'vue'
const channelList = ref([])
const getChannelList = async () => {
  const res = await artGetChannelsService()
  channelList.value = res.data.data
  // console.log(channelList.value)
}
getChannelList()

const emit = defineEmits(['update:modelValue'])

defineProps({
  modelValue: {
    type: [Number, String]
  }
})
</script>
<template>
  <el-select
    :modelValue="modelValue"
    @update:modelValue="emit('update:modelValue', $event)"
    style="width: 240px"
  >
    <el-option
      v-for="item in channelList"
      :key="item.id"
      :label="item.cate_name"
      :value="item.id"
    />
    <!-- <el-option label="体育" value="222"></el-option>--></el-select
  >
</template>
